﻿@using KRM.Core
@model KRM.Core.vKRMRSViewRejection
@if (Model != null)
{
    var db = new KRMEntities();
    var user = db.tblUsers.Find(Model.UserPlacedBy);
    var lstRejectionAction = db.tblKRMRSRejectionActions.ToList();
    lstRejectionAction.Insert(0,new tblKRMRSRejectionAction(){RejectionAction = "Please select an Action"});
    ViewBag.RejectionActionID = new SelectList(lstRejectionAction, "RejectionActionID",
                "RejectionAction", Model.RejectionActionID);
 
    @Html.Partial("Partial/_MessageResult")
    <input type="hidden" name="RejectionID" value="@Model.RejectionID"/>
    <input type="hidden" name="orderref" value="@Model.Order_Ref"/>
    <input type="hidden" name="DisputeID" value="@Model.DisputeID"/>
    <div class="row-fluid">
        <fieldset class="span5">
            <legend>RDM Details</legend>
            <div class="row-fluid">
                <div class="span4">Date Field</div>
                <div class="span8">
                        <input value="@Model.DatePlaced" class="input-block-level" type="text">
                </div>
            </div>
            <div class="row-fluid">
                <div class="span4">Agent</div>
                <div class="span8">
                    <input type="text" class="input-block-level" value="@(user != null ? user.Username : "N/A")" />
                </div>
            </div>
            <div class="row-fluid">
                <div class="span4">Order Items</div>
                <div class="span8">
                    <input type="text" class="input-block-level" value="@Model.Order_Item" />
                </div>
            </div>
            <div class="row-fluid">
                <div class="span4">RDM Items</div>
                <div class="span8">
                    <input type="text" class="input-block-level" value="@Model.DisputeItems" />
                </div>
            </div>
            <div class="row-fluid">
                <div class="span4">RDM Reason</div>
                <div class="span8">
                    <input type="text" class="input-block-level" value="@Model.Reason" />
                </div>
            </div>
            <div class="row-fluid">
                <div class="span4">Further Description</div>
                <div class="span8">
                    <textarea class="input-block-level" rows="7">@Model.Description</textarea>
                </div>
            </div>
            <div class="row-fluid">
                <div class="span4">Preferred Resolution</div>
                <div class="span8">
                    <input type="text" class="input-block-level" value="@Model.Resolution" />
                </div>
            </div>
        </fieldset>
        <div class="span7">
            <fieldset>
                <legend>Approval Details</legend>
                <div class="row-fluid">
                    <div class="span4">Action Taken</div>
                    <div class="span8">
                        <input type="text" class="input-block-level" value="@Model.Action" />
                    </div>
                </div>
                <div class="row-fluid">
                    <div class="span4">Further Details</div>
                    <div class="span8">
                        <textarea class="input-block-level">@Model.ActionDetails</textarea>
                    </div>
                </div>
            </fieldset>
            <fieldset>
                <legend>Replacement Details</legend>
                <div class="row-fluid">
                    <div class="span4">Status</div>
                    <div class="span8">
                        <input type="text" class="input-block-level" value="@Model.ReplacementStatus" />
                    </div>
                </div>
                <div class="row-fluid">
                    <div class="span4">Further Details</div>
                    <div class="span8">
                        <textarea class="input-block-level">@Model.ReplacementActionDetails</textarea>
                    </div>
                </div>
            </fieldset>
            <fieldset>
                <legend>Rejection Resolution</legend>
                <div class="row-fluid">
                    <div class="span4">Action</div>
                    <div class="span8">
                        @Html.DropDownList("RejectionActionID", null, new { @class = "input-block-level" ,required="required"})
                    </div>
                </div>
                <div class="row-fluid">
                    <div class="span4">Further Details</div>
                    <div class="span8">
                        <textarea class="input-block-level" name="RejectionActionDetails" required="required">@Model.ReplacementActionDetails</textarea>
                    </div>
                </div>
            </fieldset>
        </div>
    </div>
    <div class="border-padding10 text-right">
        <a href="/rdm/viewrdm/@Model.DisputeID" class="btn btn-success" style="margin-right: 10px" target="_blank">Revive RDM</a>
        <button type="submit" class="btn btn-primary" style="padding: 5px 30px">Save</button>
    </div>   
}